package config;

import org.springframework.beans.BeansException;
import org.springframework.beans.factory.config.BeanPostProcessor;
import org.springframework.core.Ordered;

/**
 * @Author: fancyears·milos·malvis
 * @Description: 属性设置的前后操作
 * @Date: Created in  2019/4/11 17:04
 * @Modified By:
 */
public class BeanPostProcessorBean2 implements BeanPostProcessor, Ordered {
    public Object postProcessBeforeInitialization(Object bean, String beanName) throws BeansException {
        System.out.println("2----bean初始化后set属性之->前<-的操作:  "+beanName);
        return bean;
    }

    public Object postProcessAfterInitialization(Object bean, String beanName) throws BeansException {
        System.out.println("2----bean初始化后set属性之->后<-的操作"+beanName);
        return bean;
    }

    public int getOrder() {
        return 1;
    }
}
